package com.itbaizhan.controller;

import com.itbaizhan.service.AccountInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author spf
 * @date 2024/4/13
 * @time 16:06
 */
@RestController
@RequestMapping("/bank2")
public class AcoountController {

    @Autowired
    private AccountInfoService accountInfoService;

    @GetMapping("/transfer")
    public String transfer(@RequestParam("accountNo") String accountNo,@RequestParam("amount") double amount){
        accountInfoService.transfer(accountNo, amount);
        return "李四转账成功!";
    }

}
